﻿@model PagedList.IPagedList<HZManager.Models.InventoryRecord>
@using PagedList.Mvc;
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />

@{
    ViewBag.Title = "出入库操作记录";
}

<h2>出入库操作记录</h2>

<p>
    @Html.ActionLink("新建", "Create")
</p>
@using (Html.BeginForm("Index", "出入库操作记录", FormMethod.Get))
{
    <p>
        通过操作员姓名查找: @Html.TextBox("SearchString", ViewBag.CurrentFilter as string)
        <input type="submit" value="查询" />
    </p>
}
<table class="table">
    <tr><!--页面显示并对Date跟Customer进行排序-->
        <th> @Html.ActionLink("日期", "Index", new { sortOrder = ViewBag.DateSortParm, currentFilter = ViewBag.CurrentFilter }) </th>
       <th> @Html.ActionLink("操作员", "Index", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })</th>
        <th>仓库管理员</th>
        <th>原因</th>
        <th></th>
    </tr>
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Date)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Customer)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ResponsibleOfficer)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Reason.Name)
        </td>
        <td>
            @Html.ActionLink("编辑", "Edit", new { id=item.InventoryRecordID }) |
            @Html.ActionLink("详情", "Details", new { id=item.InventoryRecordID }) |
            @Html.ActionLink("删除", "Delete", new { id=item.InventoryRecordID })
        </td>
    </tr>
}

</table>
<br />
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of
@Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("Index",new{ page,sortOrder = ViewBag.CurrentSort,currentFilter = ViewBag.CurrentFilter}))
